package filter;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;

@WebFilter(filterName="BCDFilter",urlPatterns= {"/BCDFilter","*.do","/test/*"})

public class BCDFilter implements Filter {
	public BCDFilter() {
		System.out.println("执行BCDFilter的构造方法");
	}
	public void destroy() {
		System.out.println("执行BCDFilter的destroy方法");
	}
	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
			throws IOException, ServletException {
		System.out.println("执行BCDFilter的doFilter之前的代码");
		chain.doFilter(request, response);
		System.out.println("执行BCDFilter的doFilter之后的代码");
	}
	public void init(FilterConfig fConfig) throws ServletException {
		System.out.println("执行BCDFilter的init方法");
	}
}